package org.samples.util;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import sun.misc.BASE64Encoder;

public class MD5Utils {
	
	public static String getMD5Code(String strObj){
		MessageDigest md = null;
		BASE64Encoder encoder = null;
		try {
			md = MessageDigest.getInstance("MD5");
			encoder = new BASE64Encoder();
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		}
		return encoder.encode(md.digest(strObj.getBytes()));
	}
	
}
